import { GetterTree, MutationTree, ActionTree } from 'vuex'
import { getExperienceByServe } from './url'
import { BaseStart } from '@/types/index.ts'
import * as baseApi from '@/api/base'
const state: BaseStart = {
  experience: [],
}
const getters: GetterTree<BaseStart, any> = {
  experience: (stateInfo: BaseStart) => stateInfo.experience,
}
const mutations: MutationTree<BaseStart> = {
  get_experience(stateInfo: BaseStart, data: BaseStart) {
    stateInfo.experience = data.experience
  },
}
const actions: ActionTree<BaseStart, any> = {
  get_experience({ commit }, parms) {
    return getExperienceByServe(parms)
  },
  getExper2() {
    return baseApi.getExperience()
  },
}

export default {
  state,
  getters,
  mutations,
  actions,
}
